#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'
int data[100000 * 4 + 500], head = 0, tail = -1;//data[head,tail] queue
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    while (n--) {
        int t;
        cin >> t;
        data[++tail] = t;
    }
    while (head <= tail) {
        int front = data[head++];
        cout << front << " ";
        if (head > tail)break;
        front = data[head++];
        data[++tail] = front;
    }

    return 0;
}